<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<!DOCTYPE html>
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>电子文档系统</title>
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->
	<script type="text/javascript" src="view/jquery/jquery-1.9.1.js"></script>
	<script type="text/javascript" src="view/js/docMan.js"></script>
	<script type="text/javascript" src="view/bootstrap/js/bootstrap.js"></script>
	<link rel="stylesheet" href="view/bootstrap/css/bootstrap.css">
	<link rel="stylesheet" href="view/css/docMan.css">
	<link rel="stylesheet" href="view/css/zTreeStyle.css">
	<link rel="stylesheet" href="view/toastr/toastr.css">
	<script type="text/javascript" src="view/toastr/toastr.js"></script>
	<script type="text/javascript" src="view/js/ajaxfileupload.js"></script>
	<script type="text/javascript" src="view/datapicker/laydate.js"></script>
	<link rel="stylesheet" href="view/datapicker/need/laydate.css">
<link rel="stylesheet" href="view/datapicker/skins/molv/laydate.css">
<style type="text/css">
.table>tbody>tr>td{
    padding: 3px 0px 5px 5px;
    line-height: 1.428571;
    vertical-align: middle;
    border-top: 1px solid #ddd;
}

</style>
  </head>
  <input type="hidden" id="humanId" value="${humanId}">
  <body style="background: #ffffff;">
  	<div id="main-container" class="container" style="height: 100%;width:98%;background: #ffffff">
  		<div class="row" style="height: 100%">
			<!-- <div id="left-p" class="col-sm-2" style="height: 100%;border-right: 1px solid #d2d2d2;"></div> -->
  			<div  class="col-sm-12" style="height: 100%;padding: 0px 30px 20px 30px;">
				<div class="row mt_10" style="height:44px;width: 100%">
					<!-- <form action="search.action" method="post" target="_blank" style="width: 80%;display: inline;">
						<input type="text" class="form-control" name="param"
							style="width: 20%;display: inline;">
						<button class="btn btn-primary btn-search" type="submit">全文搜索</button>
					</form> -->
					<!-- <form action="pageSearch.action" method="post" target="_blank"  style="width: 40%;display: inline;margin-right:10px;">
  						<input type="text" class="form-control" name="pageLucene.searchText" style="width: 20%;display: inline;">
  						<input type="number" class="form-control" value="1" name="pageLucene.currentPage" style="display: none;">
  						<input type="number" class="form-control" value="0" name="pageLucene.beginIndex" style="display: none;">
  						<button class="btn btn-primary " type="submit">全文搜索</button>
  					</form> -->
  					<%-- <a class="btn btn-primary" href="searchIndex.action" style="margin-left:5%;" target="_blank">全文搜索</a>
  						<a class="btn btn-default" href="myFiles.action" style="margin-left:1%;" target="_blank">我的文件</a>
  					<!-- 开始<input type="date" name="pageLucene.startDate"  style="margin-right:10px;margin-left:10px;padding:3px 4px;" />结束<input  name="pageLucene.endDate"  type="date"style="margin-left:10px;padding:3px 4px;"/> -->
					<form action="logout.action" method="post" style="width:20%;display: inline;float: right;">
  						当前登入：${session.humanName}<button type="submit" class="btn btn-link">退出</button>
  					</form> --%>
				</div>
				<div class="row" style="height:44px;background: #F5F5F5">
					<ol class="breadcrumb" style="padding: 12px 15px;">
						<li><a href="knowledge.action" class="link">知识管理</a></li>
						
						<!-- <li><a href="#">Library</a></li>
						<li class="active">Data</li> -->
					</ol>
				</div>
				<div class="row" style="height: 45px;">
  					<!-- <button id="btn-back" class="btn btn-default mt_10 ml_10" style="height: 25px;padding: 2px 12px 2px 12px;" onclick="back();">返回上级</button> -->
  					<!-- <button id="btn-uploadFile2disk" class="btn btn-primary mt_10 ml_10" style="height: 25px;padding: 2px 12px 2px 12px;">上传文件</button> -->
  					<button id="btn-createDirectory-modal" class="btn btn-default mt_10 ml_10" style="height: 25px;padding: 2px 12px 2px 12px;">新建文件夹</button>
  					<button id="btn-refresh" class="btn btn-default mt_10 ml_10" style="height: 25px;padding: 2px 12px 2px 12px;">刷新</button>
  					<button id="del_confirm_btn" class="btn btn-default mt_10 ml_10" style="height: 25px;padding: 2px 12px 2px 12px;" >删除</button>
  					<!-- <button id="btn_copy_file_modal" class="btn btn-default mt_10 ml_10" style="height: 25px;padding: 2px 12px 2px 12px;" >复制</button --><!--  -->
  					<!-- <button id="btn_move_file_modal" class="btn btn-default mt_10 ml_10" style="height: 25px;padding: 2px 12px 2px 12px;" >移动</button> -->
  					<!-- <button id="btn_forward_file_modal" class="btn btn-default mt_10 ml_10" style="height: 25px;padding: 2px 12px 2px 12px;" >共享</button> -->
  					<!-- <button id="btn_index_dir" class="btn btn-primary mt_10 ml_10" style="height: 25px;padding: 2px 12px 2px 12px;" >初始化</button> -->
  					<%-- <button id="btn_unaccept_file" class="btn btn-primary mt_10 ml_10" style="height: 25px;padding: 2px 12px 2px 12px;" >未接收文件
  						<s:if test="#session.forwardCount>0">
  							<div id="unacceptCount" style="float: right;width: 20px;background-color: red;border-radius: 8px;margin-left: 5px;display: block;">${session.forwardCount}</div>
  						</s:if>
  						<s:else>
  							<div id="unacceptCount" style="float: right;width: 20px;background-color: red;border-radius: 8px;margin-left: 5px;display: none;">5</div>
  						</s:else>
  					</button> --%>
  				</div>
  				<div class="row " style="height: 37px;background: #F9F9F9;border-top: 1px solid #3792e5;" >
  					<div class="ver-middle text-c" style="height:100%;width: 8%;float: left;padding: 7px;">
  						<span class="bold">全选  </span><input type="checkbox" id="del_all_cbx">
  					</div>
  					<div class="ver-middle" style="height: 100%;width: 50%;float: left;padding: 7px;">
  						<span class="bold">名称</span>
  					</div>
  					<div class="ver-middle " style="height: 100%;width: 17%;float:left;padding: 7px;">
  						<span class="bold">创建人</span>
  					</div>
  					<div class="ver-middle" style="height: 100%;width: 25%;float: left;padding: 7px;">
  						<span class="bold">上传时间</span>
  					</div>
  				</div>
  				<div class="row border_top directory_list">
	  				<s:iterator value="docDirectories" id="directory" status="stu">
	  					<div class="directory border_bottom" style="height: 40px;">
	  						<div class="text-c" style="height:100%;width: 8%;float: left;padding: 8px;">
	  							<!-- <input type="checkbox"> -->
	  						</div>
	  						<div style="height: 100%;width: 50%;float: left;padding: 8px;">
	  							<div style="width: 10%;height: 100%;float: left;">
	  								<div class="diskpic-file"
									style="float: left;"></div>
	  							</div>
								<div class="row ver-middle" style="float: left">
									<a href="directoryView.action?directoryId=<s:property value="#directory.id" />" style="margin-right: 5px;" ><s:property  value="#directory.reName" /> </a>
									<span class="muted">(文件夹：<s:property value="#directory.directoryCount" />，文件：<s:property value="#directory.fileCount" />)</span>
								</div>
							</div>
							<div class=""
								style="height: 100%;width: 17%;float:left;padding: 7px;">
								<span class="muted"><s:property value="#directory.humanName" /> </span>
							</div>
							<div class="ver-middle"
								style="height: 100%;width: 25%;float: left;padding: 7px;">
								<a href="javascript:void(0)" class="btn-directory-attr" id='<s:property value="#directory.id" />' style="font-size: 12px;color: #06c;">属性</a>
								<span class="muted">&nbsp;|&nbsp;</span>
								<a href="javascript:void(0)" class="btn-delDir-modal" id='<s:property value="#directory.id" />' style="font-size: 12px;color: #06c;">删除</a>
							</div>
						</div>
	  				</s:iterator>
  				</div>
  				<div class="row file_list">
	  				<s:iterator value="docFiles" id="file" status="stu">
	  					<div class="file border_bottom" style="height: 57px;">
	  						<div class="text-c" style="height:100%;width: 8%;float: left;padding:15px 8px;">
	  							<input type="checkbox" id='<s:property value="#file.id" />' name="del_cbx">
	  						</div>
	  						<div style="height: 100%;width: 50%;float: left;padding: 8px;">
		  						<div style="height: 100%;width: 10%;float: left">
		  							<div class="<s:property value="#file.imgClass" /> ico_cnt "
										style="float: left;"></div>
		  						</div>
								<div class="row ver-middle" style="float: left">
									<div class=" ellipsis">
										<a id='name<s:property value="#file.id" />' class="btn_look_pdf" title="<s:property value="#file.displayFileName" /> " href="docPreview.action?fileId=<s:property value="#file.id" />&indexFrom=0" style="margin-right: 5px;"><s:property value="#file.displayFileName" /> </a>
									</div>
									<div class="">
										<a href="dowloadFile.action?id=<s:property value="#file.id" />&indexFrom=0 "  class=" " style="font-size: 12px;color: #06c;">下载</a>
										<a href="docPreview.action?fileId=<s:property value="#file.id" />&indexFrom=0"   class="ml_10 btn_look_pdf" style="font-size: 12px;color: #06c;">预览</a>
										<a href="javascript:void(0)" id="<s:property value="#file.id" />" class="ml_10 file_record" style="font-size: 12px;color: #06c;">访问记录</a>
										<a href="javascript:void(0)" id="<s:property value="#file.id" />" type="0" class="ml_10 file_collect" style="font-size: 12px;color: #06c;">收藏</a>
										<!-- <a href="" class="ml_10 " style="font-size: 12px;color: #06c;">属性</a> -->
									</div>
								</div>
							</div>
							<div class=""
								style="height: 100%;width: 17%;float:left;padding: 15px 8px;">
								<span class="muted"><s:property value="#file.humanName" /> </span>
							</div>
							<div class="ver-middle"
								style="height: 100%;width: 25%;float: left;padding: 12px 8px;">
								<span class="muted"><s:date format="yyyy-MM-dd hh:mm" name="#file.createTime"/> </span>
							</div>
						</div>
	  				</s:iterator>
  				</div>
  			</div>
  		</div>
  	</div>
	<div class="modal fade" id="directoryCreateModal" tabindex="-1" role="dialog"
		aria-labelledby="exampleModalLabel">
		<div class="modal-dialog" role="document">
			<div class="modal-content">
				<div class="modal-header">
					<button type="button" class="close" data-dismiss="modal"
						aria-label="Close">
						<span aria-hidden="true">&times;</span>
					</button>
					<h4 class="modal-title" id="exampleModalLabel">新建文件夹</h4>
				</div>
				<div class="modal-body">
					<form>
						<div class="form-group">
							<label for="directoryName" class="control-label">文件夹名字:</label>
							<input type="text" class="form-control" id="directoryName" placeholder="文件夹名称长度不能大于30"  >
						</div>
						<div class="form-group">
							<label for="dirRange" class="control-label">可见范围:</label> <select
								id="dirRange" class="form-control">
									<!-- <option value="1" selected="selected">部门可见</option> -->
									<option value="0" selected="selected">全局可见</option>
									<!-- <option value="2">自定义人员</option> -->
							</select>
						</div>
						<div id="inputHuman" style="display: none;" class="row">
							<span class="col-xs-2">输入人员:</span> <input id="humanName"
								style="width:58%" class="col-xs-7 form-control">
							<button id="btn-add-human" type="button" class="btn btn-default ml_10">添加</button>
						</div>
						<div id="humanNames"  class="row" style="padding:0px 20px;">
							<%-- <div   class="human_tag">
								<span style="width:60%;">潘善亮</span>
								<div class="human_tag_remove">
									<span class="glyphicon glyphicon-remove" style="font-size:2px;color:#fff;"></span>
								</div>
							</div> --%>
						</div>
					</form>
				</div>
				<div class="modal-footer">
					<button type="button" id="btn-directory-creat" class="btn btn-primary">创建</button>
					<button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
				</div>
			</div>
		</div>
	</div>
	<div class="modal fade" id="uploadFileModal" tabindex="-1" role="dialog"
		aria-labelledby="exampleModalLabel">
		<div class="modal-dialog" role="document">
			<div class="modal-content">
				<div class="modal-header">
					<button type="button" class="close" data-dismiss="modal"
						aria-label="Close">
						<span aria-hidden="true">&times;</span>
					</button>
					<h4 class="modal-title" id="exampleModalLabel">上传文件</h4>
				</div>
				<div class="modal-body">
					<input type="file" name="oafile" id="upFile" onchange="uploadfile();" style="height: 0px;width: 0px;">
					<div class="row ">
						<div class="col-xs-2" >
							<div style="float: right">
								<span style="color:red;" >* </span>文件：
							</div>
						</div>
						<div  class="col-xs-9">
							<div id="fileUploadList" class="">
								<%-- <div class="row file">
									<div class="col-xs-6">
										<span class=""> 2012新生名单分班人数8月2 </span>
									</div>
									<div class="col-xs-4">
										<span class="muted fileSize"> (1.78M) </span>
										<button  class="btn btn-link padding_clear ">删除</button>
									</div>
								</div> --%>
							</div>
							<div class="row">
								<i class="commpic-attach"></i>
								<button id="" onclick="clickinput();" class="btn btn-link">上传文件</button>
							</div>
						</div>
					</div>
				</div>
				<div class="modal-footer">
					<button type="button" id="btn-upload-file" class="btn btn-primary">上传</button>
					<button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
				</div>
			</div>
		</div>
	</div>
	<div class="modal fade" id="directoryAttrModal" tabindex="-1" role="dialog"  aria-hidden="false"
		aria-labelledby="exampleModalLabel">
		<div class="modal-dialog" role="document">
			<div class="modal-content">
				<div class="modal-header">
					<button type="button" class="close" data-dismiss="modal"
						aria-label="Close">
						<span aria-hidden="true">&times;</span>
					</button>
					<h4 class="modal-title" id="exampleModalLabel">文件夹信息</h4>
				</div>
				<div class="modal-body">
					<div class="row" >
						<div class="col-xs-3">
							<div class="diskpic-file fr"></div>
						</div>
						<div class="col-xs-9 ">
							<input id="directoryNameAttr" class="form-control" value='' >
						</div>
					</div>
					<div class="row mt_5">
						<div class="col-xs-3 ">
							<span class="muted fr">占用空间：</span>
						</div>
						<div class="col-xs-9">
							<span id="directorySize"></span>
						</div>
					</div>
					<div class="row mt_5">
						<div class="col-xs-3 ">
							<span class="muted fr">包含：</span>
						</div>
						<div class="col-xs-9">
							<span id="directoryContain"></span>
						</div>
					</div>
					<div class="row mt_5">
						<div class="col-xs-3 ">
							<span class="muted fr">创建信息：</span>
						</div>
						<div class="col-xs-9">
							<span id="directoryCreate"></span>
						</div>
					</div>
					<div class="row mt_5">
						<div class="col-xs-3 ">
							<span class="muted fr">所在目录：</span>
						</div>
						<div class="col-xs-9">
							<span id="directoryLocation"></span>
						</div>
					</div>
					<div class="row mt_5">
						<div class="col-xs-3 ">
							<span class="muted fr">可见范围：</span>
						</div>
						<div class="col-xs-9">
							<select
								id="dirRangeAttr" class="form-control" >
									<option value="1" selected="selected">部门可见</option>
									<option value="0">全局可见</option>
									<option value="2">自定义人员</option>
							</select>
						</div>
					</div>
					<div id="inputHumanAttr" style="display: none;" class="row mt_5">
						<div class="col-xs-3 ">
							<span class="muted fr">输入人员：</span>
						</div>
						<div class="col-xs-9">
							<input id="humanNameAttr"
							style="width:58%" class="col-xs-7 form-control">
						<button id="btn-add-humanAttr" type="button"
							class="btn btn-default ml_10">添加</button>
						</div>
					</div>
					<div id="humanNamesAttr" class="row " style="padding:0px 30px;">
						<%-- <div class="human_tag">
							<span style="width:60%;">潘善亮</span>
							<div class="human_tag_remove">
								<span class="glyphicon glyphicon-remove"
									style="font-size:2px;color:#fff;"></span>
							</div>
						</div> --%>
					</div>
				</div>
				<div class="modal-footer">
					<button type="button" id="btn-directory-save" value="" class="btn btn-primary">保存</button>
					<button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
				</div>
			</div>
		</div>
	</div>
	<div id="delModal" class="modal fade">
		<div class="modal-dialog">
			<div class="modal-content">
				<div class="modal-header">
					<button type="button" class="close" data-dismiss="modal">
						<span aria-hidden="true">×</span><span class="sr-only">关闭</span>
					</button>
					<h4 class="modal-title center bold">文件删除</h4>
				</div>
				<div class="modal-body">
					<div class="row ml_20">
						<span >确认删除这些文件，删除操作无法恢复</span>
					</div>
				</div>

				<div class="modal-footer">
					<div class="row">
						<div class="col-md-3"></div>
						<div class="col-md-4">
							<button type="button" id="btn_del" class="btn btn-danger "
								>删除</button>
							<button type="button" class="btn btn-default"
								data-dismiss="modal">取消</button>
						</div>
						<div class="col-md-4"></div>
					</div>
				</div>
			</div>
		</div>

	</div>
	<div id="delDirModal" class="modal fade">
		<div class="modal-dialog">
			<div class="modal-content">
				<div class="modal-header">
					<button type="button" class="close" data-dismiss="modal">
						<span aria-hidden="true">×</span><span class="sr-only">关闭</span>
					</button>
					<h4 class="modal-title center bold">文件夹删除</h4>
				</div>
				<div class="modal-body">
					<div class="row ml_20">
						<span >确认删除文件夹和文件夹下的所有文件，删除操作无法恢复</span>
					</div>
				</div>

				<div class="modal-footer">
					<div class="row">
						<div class="col-md-3"></div>
						<div class="col-md-4">
							<button type="button" value="" id="btn_deleteDir" class="btn btn-danger "
								>删除</button>
							<button type="button" class="btn btn-default"
								data-dismiss="modal">取消</button>
						</div>
						<div class="col-md-4"></div>
					</div>
				</div>
			</div>
		</div>
	</div>
	<div class="modal fade" id="fileRecordModal" tabindex="-1" role="dialog"  aria-hidden="false"
		aria-labelledby="exampleModalLabel">
		<div class="modal-dialog" role="document">
			<div class="modal-content">
				<div class="modal-header">
					<button type="button" class="close" data-dismiss="modal"
						aria-label="Close">
						<span aria-hidden="true">&times;</span>
					</button>
					<h4 class="modal-title" id="exampleModalLabel">文件夹信息</h4>
				</div>
				<div class="modal-body">
					<div class="row" >
						<div class="col-xs-3">
							<div class="diskpic-file fr"></div>
						</div>
						<div class="col-xs-9 ">
							<input disabled="disabled" id="fileNameAttr" class="form-control" value='' >
						</div>
					</div>
					<div class="row mt_5">
						<div class="col-xs-3 ">
							<span class="muted fr">占用空间：</span>
						</div>
						<div class="col-xs-9">
							<span id="fileSize"></span>
						</div>
					</div>
					<div class="row mt_5">
						<div class="col-xs-3 ">
							<span class="muted fr">创建信息：</span>
						</div>
						<div class="col-xs-9">
							<span id="fileCreate"></span>
						</div>
					</div>
					<div class="row mt_5 ">
						<div class="col-xs-3 ">
							<span class="muted fr">访问记录：</span>
						</div>
						<div class="col-xs-9 ">
							<div class="row" style="width: 100%">
										<div class="col-xs-3 " style="width: 30%;display: inline;font: bold;">人员</div>
										<div class="col-xs-6 " style="width: 50%;display: inline;font: bold;">时间</div>
										<div class="col-xs-3 " style="width: 20%;display: inline;font: bold;">方式</div>
							</div>
							<div class="row scorll-y-maxheight">
								<table class="table table-striped ">
								<tbody class="record_list  muted" >
								</tbody>
							</table>
							</div>
						</div>
					</div>
				</div>
				<div class="modal-footer">
					<!-- <button type="button" id="btn-directory-save" value="" class="btn btn-primary">保存</button> -->
					<button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
				</div>
			</div>
		</div>
	</div>
	<div id="indexDirModal" class="modal fade">
		<div class="modal-dialog">
			<div class="modal-content">
				<div class="modal-header">
					<button type="button" class="close" data-dismiss="modal">
						<span aria-hidden="true">×</span><span class="sr-only">关闭</span>
					</button>
					<h4 class="modal-title center bold">文件夹下文件建立索引</h4>
				</div>
				<div class="modal-body">
					<div class="row ml_20 " id="">
						<span id="dirIndexFileCount"></span>&nbsp;  选择归档年份&nbsp;<select id="indexNd">
						</select>
					</div>
					<div class="progress" style="display:none;">
						<div id="progress-bar" class="progress-bar progress-bar-striped active"
							role="progressbar" aria-valuenow="45" aria-valuemin="0"
							aria-valuemax="100" style="width: 2%;">
							<span class="sr-only">0% </span>
						</div>
					</div>
				</div>

				<div class="modal-footer">
					<div class="row">
						<div class="col-md-3"></div>
						<div class="col-md-7">
							<button type="button" value="" id="btn_start_indexDir" class="btn btn-primary "
								>开始建立索引</button>
							<button type="button" class="btn btn-default"
								data-dismiss="modal">取消</button>
						</div>
						<div class="col-md-1"></div>
					</div>
				</div>
			</div>
		</div>

	</div>
	
	<div class="modal fade" id="collectFileModal" tabindex="-1" role="dialog"
		aria-labelledby="exampleModalLabel">
		<div class="modal-dialog" role="document">
			<div class="modal-content">
				<div class="modal-header">
					<button type="button" class="close" data-dismiss="modal"
						aria-label="Close">
						<span aria-hidden="true">&times;</span>
					</button>
					<h4 class="modal-title" id="exampleModalLabel">文件收藏</h4>
				</div>
				<div class="modal-body">
					<span class="">请选择目标文件夹</span>
					<div class="row myDir_lists linktreeWrap margine_clear mt_10">
						<ul class="disk-copy-ul unstyled">
					  	  <li >
					      	  <a href="javascript:void(0);" class="myFirstDir" id="${personalDirId}">
					      	       <i class="diskpic-copy-right mgtDiskListArrows"></i>
					      	  </a>                                          
					      	  <span class="ch mgtActive"><i class="diskpic-smallbox"></i><span class="me-margin-left5">我的网盘</span></span>
					      </li>
						</ul>
					</div>
				</div>
				<div class="modal-footer">
					<button type="button" id="btn_collect" class="btn btn-primary">确定</button>
					<button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
				</div>
			</div>
		</div>
	</div>
	<div id="pfdModal" class="modal fade">
		<div class="modal-dialog">
			<div class="modal-content">
				<div class="modal-body">
					<iframe id="pdfIframe" name="pdfIframe" contextmenu="return false"
						scrolling="yes" src=""
						style="width:100%;height: 100%;@media print{ body{display:none} } ">
					</iframe>
				</div>
				<div class="">
					<div class="row">
						<div class="col-md-5"></div>
						<div class="col-md-4">
							<button type="button" class="btn btn-primary"
								data-dismiss="modal">返回</button>
							<!-- <button type="button" class="btn btn-danger print"
											>打印</button> -->
						</div>
						<div class="col-md-4"></div>
					</div>
				</div>
			</div>
		</div>
	</div>
	<div class="modal fade" id="fileCopyModal" tabindex="-1" role="dialog"
		aria-labelledby="exampleModalLabel">
		<div class="modal-dialog" role="document">
			<div class="modal-content">
				<div class="modal-header">
					<button type="button" class="close" data-dismiss="modal"
						aria-label="Close">
						<span aria-hidden="true">&times;</span>
					</button>
					<h4 class="modal-title" id="exampleModalLabel">文件复制</h4>
				</div>
				<div class="modal-body">
					<span class="">请选择目标文件夹</span>
					<div class="row myDir_lists linktreeWrap margine_clear mt_10">
						<ul class="disk-copy-ul unstyled">
							<li><a href="javascript:void(0);" class="myFirstDir"
								id="${personalDirId}"> <i
									class="diskpic-copy-right mgtDiskListArrows"></i>
							</a> <span class="ch mgtActive"><i class="diskpic-smallbox"></i><span
									class="me-margin-left5">我的网盘</span></span></li>
						</ul>
					</div>
					
					<div class="row copyFiles  margine_clear mt_10" style="padding: 7px 10px 0px 15px;">
					</div>
					
				</div>
				<div class="modal-footer">
					<button type="button" id="btn-copy-file" class="btn btn-primary">复制</button>
					<button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
				</div>
			</div>
		</div>
	</div>
	<div class="modal fade" id="fileMoveModal" tabindex="-1" role="dialog"
		aria-labelledby="exampleModalLabel">
		<div class="modal-dialog" role="document">
			<div class="modal-content">
				<div class="modal-header">
					<button type="button" class="close" data-dismiss="modal"
						aria-label="Close">
						<span aria-hidden="true">&times;</span>
					</button>
					<h4 class="modal-title" id="exampleModalLabel">文件移动</h4>
				</div>
				<div class="modal-body">
					<span class="">请选择目标文件夹</span>
					<div class="row myDir_lists linktreeWrap margine_clear mt_10">
						<ul class="disk-copy-ul unstyled">
							<li><a href="javascript:void(0);" class="myFirstDir"
								id="${personalDirId}"> <i
									class="diskpic-copy-right mgtDiskListArrows"></i>
							</a> <span class="ch mgtActive"><i class="diskpic-smallbox"></i><span
									class="me-margin-left5">我的网盘</span></span></li>
						</ul>
					</div>
					
					<div class="row moveFiles  margine_clear mt_10" style="padding: 7px 10px 0px 15px;">
					</div>
					
				</div>
				<div class="modal-footer">
					<button type="button" id="btn-move-file" class="btn btn-primary">移动</button>
					<button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
				</div>
			</div>
		</div>
	</div>
	<div class="modal fade" id="fileForwardModal" tabindex="-1" role="dialog"
		aria-labelledby="exampleModalLabel">
		<div class="modal-dialog" role="document">
			<div class="modal-content">
				<div class="modal-header">
					<button type="button" class="close" data-dismiss="modal"
						aria-label="Close">
						<span aria-hidden="true">&times;</span>
					</button>
					<h4 class="modal-title" id="exampleModalLabel">文件移动</h4>
				</div>
				<div class="modal-body">
					<div style="width:45%;float: left;">
						<span class="">请选择目标文件夹</span>
						<div class="row myDir_lists linktreeWrap margine_clear mt_10" style="height:250px;overflow:scroll;">
							<ul id="untishuman" class="disk-copy-ul unstyled ztree">
								<li><a href="javascript:void(0);" class=""
									id="451"><i class="diskpic-copy-right mgtDiskListArrows"></i></a>
									<input type="checkbox"> <span id="jingoalTree1_17_ico"
									title="" treenode_ico="" class="button ico_docu" style=""></span>
									<span class="ch mgtActive"><span
										class="me-margin-left5">我的收藏</span></span></li>
								<li><a href="javascript:void(0);" class="myUnit"
									id="451"><i class="diskpic-copy-right mgtDiskListArrows"></i></a>
									<input type="checkbox"> <span id="jingoalTree1_17_ico"
									title="" treenode_ico="" class="button ico_close" style=""></span>
									<span class="ch mgtActive"><span
										class="me-margin-left5">我的收藏</span></span></li>
							</ul>
						</div>
					</div>
					<div style="width:10%;float: left;height:250px;">
						
					</div>
					<div style="width:45%;float: left;height:250px;">
						 <span class=""> 已选择人员  </span>
						<div class="row myDir_lists linktreeWrap margine_clear mt_10" style="height:250px;overflow:scroll;">
							<ul class="disk-copy-ul unstyled humanSelectList ztree">
								<%-- <li id="" class="human" style="color: blue;"><span id="jingoalTree1_17_ico" 
									title="" treenode_ico="" class="button ico_docu" style="margin-top:0px;"></span>周汶锜</li>
								<li id="" class="unit" style="color: blue;"><span id="jingoalTree1_17_ico"
									title="" treenode_ico="" class="button ico_close" style="margin-top:0px;"></span>周汶锜</li> --%>
							</ul>
						</div>
					</div>
					<div class=" forwardFiles  margine_clear mt_10" style="padding: 7px 10px 0px 15px;margin-top:270px;">
					</div>
				</div>
				<div class="modal-footer">
					<button type="button" id="btn-forward-file" class="btn btn-primary">发送文件</button>
					<button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
				</div>
			</div>
		</div>
	</div>
	
	
	<div class="modal fade" id="unAcceptForwardModal" tabindex="-1" role="dialog"
		aria-labelledby="exampleModalLabel">
		<div class="modal-dialog" role="document">
			<div class="modal-content">
				<div class="modal-header">
					<button type="button" class="close" data-dismiss="modal"
						aria-label="Close">
						<span aria-hidden="true">&times;</span>
					</button>
					<h4 class="modal-title" id="exampleModalLabel">未接收文件</h4>
				</div>
				<div class="modal-body" style="min-height: 300px;overflow: scroll;">
					<table class="table table-bordered " >
						<thead>
							<tr>
								<th>来自</th>
								<th>时间</th>
								<th>文件名</th>
								<th>操作</th>
							</tr>
						</thead>
						<tbody id="unAcceptForwardTable">
							<tr>
								<td>潘善亮</td>
								<td>2016-10-2</td>
								<td>单位单位的氛围分为氛围分为</td>
								<td>
									<button class="btn btn-danger">删除</button> 
									<button class="btn btn-primary">接收</button>
								</td>
							</tr>
						</tbody>
					
					</table>
				</div>
				<div class="modal-footer">
					<!-- <button type="button" id="btn-forward-file" class="btn btn-primary">发送文件</button> -->
					<button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
				</div>
			</div>
		</div>
	</div>
	<div id="delForwardModal" class="modal fade">
		<div class="modal-dialog">
			<div class="modal-content">
				<div class="modal-header">
					<button type="button" class="close" data-dismiss="modal">
						<span aria-hidden="true">×</span><span class="sr-only">关闭</span>
					</button>
					<h4 class="modal-title center bold">删除未接收文件</h4>
				</div>
				<div class="modal-body">
					<div class="row ml_20">
						<span >确认删除问接收文件</span>
					</div>
				</div>

				<div class="modal-footer">
					<div class="row">
						<div class="col-md-3"></div>
						<div class="col-md-4">
							<button type="button" value="" id="btn_delete_forward" class="btn btn-danger "
								>删除</button>
							<button type="button" class="btn btn-default"
								data-dismiss="modal">取消</button>
						</div>
						<div class="col-md-4"></div>
					</div>
				</div>
			</div>
		</div>
	</div>
	
	<div class="modal fade" id="acceptForwardModal" tabindex="-1" role="dialog"
		aria-labelledby="exampleModalLabel">
		<div class="modal-dialog" role="document">
			<div class="modal-content">
				<div class="modal-header">
					<button type="button" class="close" data-dismiss="modal"
						aria-label="Close">
						<span aria-hidden="true">&times;</span>
					</button>
					<h4 class="modal-title" id="exampleModalLabel">文件接收</h4>
				</div>
				<div class="modal-body">
					<span class="">请选择目标文件夹</span>
					<div class="row myDir_lists linktreeWrap margine_clear mt_10">
						<ul class="disk-copy-ul unstyled">
							<li><a href="javascript:void(0);" class="myFirstDir"
								id="${personalDirId}"> <i
									class="diskpic-copy-right mgtDiskListArrows"></i>
							</a> <span class="ch mgtActive"><i class="diskpic-smallbox"></i><span
									class="me-margin-left5">我的网盘</span></span></li>
						</ul>
					</div>
					
					<div class="row acceptFiles  margine_clear mt_10" style="padding: 7px 10px 0px 15px;">
					</div>
					<input type="hidden" id="acceptForwardId">
				</div>
				<div class="modal-footer">
					<button type="button" id="btn-accept" class="btn btn-primary">接收</button>
					<button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
				</div>
			</div>
		</div>
	</div>
</body>

  <script type="text/javascript">
  $(function(){
	  $(".btn_look_pdf").on("click",function(){
	  		var url=$(this).attr("href");
	  	/* 	$("#pdf").attr("src",url);
	  		$("#pdfModal").toggle(400); */
	  		var height=$(window).height();
			var width=$(window).width();
			var pdf=$("#pfdModal");
			$("#pdfIframe").attr('src',url);
			$()
			pdf.find(".modal-body").css({
				height:height-60
			});
			pdf.find(".modal-dialog").css({
				width:width,
				height:height,
				margin:0
			});
			pdf.modal('show').css({
				 width: width,
	             height:height
			});
			return false;
	  	});
	  $("#btn-createDirectory-modal").on("click",function(){
			$("#directoryCreateModal").modal({backdrop: 'static', keyboard: false,show:true});
	  });
	  $("#btn-directory-creat").on("click",function(){
		  var directoryName=$("#directoryName").val().trim();
		  var directoryId=0;//知识管理下的顶级directoryId=0
		  var directoryRange=$("#dirRange").children('option:selected').val(); 
		  var humanIds=new Array();
		  if(directoryRange==2){//文件夹的可视范围为自定义
		  	  $($(".human_tag")).each(function(i,e){
		  		  humanIds[i]=$(this).attr('id');
		  	  });
		  }
		  $.ajax({
			 type:"post",
			 url:"/DocMan/webService/show/DocDirectory/saveOrUpdate",
			 //isKnowledge=1表示是知识库下的文件夹
			 data:{isKnowledge:1,name:directoryName,reName:directoryName,id:0,directoryId:directoryId,displayRange:directoryRange,humanIds:humanIds},
			 traditional:true,
			 success:function(data){
				 console.info(data);
				 if(data["success"]){
					 var directory="<div class=\"directory border_bottom\" style=\"height: 40px;\">"+
										"<div class=\"text-c\" style=\"height:100%;width: 8%;float: left;padding: 8px;\">"+
										"</div>"+
										"<div style=\"height: 100%;width: 50%;float: left;padding: 8px;\">"+
										"<div style=\"width: 10%;height: 100%;float: left;\">"+
												"<div class=\"diskpic-file\"style=\"float: left;\"></div>"+
											"</div>"+
										"<div class=\"row ver-middle\" style=\"float: left\">"+
											"<a href=\"directoryView.action?directoryId="+data["directory"].id+"\" style=\"margin-right: 5px;\">"+data["directory"].reName+"</a><span class=\"muted\">(文件夹："+data["directory"].fileCount+"，文件："+data["directory"].directoryCount+")</span>"+
										"</div>"+
									"</div>"+
									"<div class=\"\" style=\"height: 100%;width: 17%;float:left;padding: 7px;\">"+
										"<span class=\"muted\" >"+data["directory"].humanName+"</span>"+
									"</div>"+
									"<div class=\"ver-middle\" style=\"height: 100%;width: 25%;float: left;padding: 7px;\">"+
										"<a href=\"javascript:void(0)\" class=\"btn-directory-attr\" id='"+data["directory"].id+"' style=\"font-size: 12px;color: #06c;\"> 属性 </a>"+
										"<span class=\"muted \" >&nbsp;|&nbsp;</span>"+
										"<a class=\"\" style=\"font-size: 12px;color: #06c;\"> 删除 </a>"+
									"</div>"+
								"</div>";
					 $(".directory_list").append(directory);
					 $("#directoryCreateModal").modal('hide');
				 }else{
				 	toast.error(data["message"], "温馨提示");
				 	$("#directoryCreateModal").modal('hide');
				 }
			 },
			 error:function(data){
				 toast.error("创建网盘错误", "温馨提示");
			 }
		  });
	  });
	  $("#btn-uploadFile2disk").on("click",function(){
		 $("#uploadFileModal").modal({backdrop: 'static', keyboard: false,show:true});
	  });
	  $("#btn-upload-file").on("click",function(){
		  var filePathsBtn= $("#fileUploadList").find(".filePath");
		  var fileSizeSpans=$("#fileUploadList").find(".fileSize");
		  var directoryId=string.getUrlParam("directoryId");
		  var filePaths=new Array();
		  var fileSizes=new Array();
		  $(filePathsBtn).each(function(i,e){
			  filePaths[i]=e.value;
		  });
		  $(fileSizeSpans).each(function(i,e){
			 fileSizes[i]=e.id;
		  });
		  //type=1 表示文件在文件夹下，type=2表示文件在网盘下
		  $.ajax({
			 type:"post",
			 url:"/DocMan/webService/show/DocFile/createFiles",
			 traditional:true,
			 data:{filePaths:filePaths,fileSizes:fileSizes,id:directoryId,type:1},
			 success:function(data){
				 console.info(data);
				 if(data["success"]){
					 	$(data["files"]).each(function(i,e){
						 var fileStr="<div class=\"file border_bottom\" style=\"height: 57px;\">"+
											"<div class=\"text-c\" style=\"height:100%;width: 8%;float: left;padding:15px 8px;\">"+
												"<input type=\"checkbox\" name=\"del_cbx\" id=\""+e.id+"\">"+
											"</div>"+
											"<div style=\"height: 100%;width: 50%;float: left;padding: 8px;\">"+
					  						"<div style=\"height: 100%;width: 10%;float: left\">"+
					  							"<div class=\" "+e.imgClass+" ico_cnt\"style=\"float: left;\"></div>"+
					  						"</div>"+
											"<div class=\"row ver-middle\" style=\"float: left\">"+
												"<div class=\"\">"+
													"<a href=\"dowloadFile.action?id="+e.id+" \" target=\"_blank\" style=\"margin-right: 5px;\">"+e.fileName+"</a>"+
												"</div>"+
												"<div class=\"\" id=\""+e.id+"\">"+
													"<a href=\"dowloadFile.action?id="+e.id+" \" target=\"_blank\" style=\"font-size: 12px;color: #06c;\">下载</a>"+
													"<a href=\"docPreview.action?fileId="+e.id+" \" class=\"ml_10 \" style=\"font-size: 12px;color: #06c;\">预览</a>"+
													"<a href=\"javascript:void(0) \" class=\"ml_10 file_record\" style=\"font-size: 12px;color: #06c;\">访问记录</a>"+
													/* "<a class=\"ml_10 \" style=\"font-size: 12px;color: #06c;\">属性</a>"+ */
												"</div>"+
											"</div>"+
										"</div>"+
										"<div class=\"\"style=\"height: 100%;width: 17%;float:left;padding: 15px 8px;\">"+
											"<span class=\"muted\">"+e.humanName+"</span>"+
										"</div>"+
										"<div class=\"ver-middle\" style=\"height: 100%;width: 25%;float: left;padding: 12px 8px;\">"+
											"<span class=\"muted\">"+e.createTime+"</span>"+
										"</div>"+
									"</div>";
								$(".file_list").append(fileStr);
								$("#fileUploadList").find(".file").remove();
					 });
					 $("#uploadFileModal").modal('hide');
				 }else{
				 	toast.error(data["message"], "温馨提示");
				 	$("#fileUploadList").find(".file").remove();	
				 	 $("#uploadFileModal").modal('hide');
				 }
				 //TODO
			 },
			 error:function(data){
				 console.info(data);
			 }
		  });
	  });
  });
  function uploadfile(){
	  var name=$("#upFile").val();
	  var index=name.lastIndexOf("\\");
	  var fileName=name.substring(index+1,name.length);
	  var file=document.getElementById('upFile').files[0];
	  var fileSize="";
	  if (file.size > 1024 * 1024)
          fileSize = (Math.round(file.size * 100 / (1024 * 1024)) / 100).toString() + 'MB';
      else
          fileSize = (Math.round(file.size * 100 / 1024) / 100).toString() + 'KB';
	  console.info(name+fileSize+fileName);
	  $.ajaxFileUpload({
			url:"asynUpload.action",
			secureuri:false,
			fileElementId:'upFile',
			dataType:'json',
			success:function(data,status){
				console.info(data);
				var filePath=data.filePath;
				console.info(filePath);
				var file="<div class=\"row file\">"+
							"<div class=\"col-xs-6\">"+
								"<span class=\"\">"+fileName+"</span>"+
							"</div>"+
							"<div class=\"col-xs-4\">"+
								"<span class=\"muted fileSize \" id=\""+fileSize+"\"> ("+fileSize+") </span>"+
								"<button value=\""+filePath+"\" class=\"btn btn-link padding_clear filePath\">删除</button>"+
							"</div>"+
						 "</div>";
				$("#fileUploadList").append(file);
				//$("#serverFilePath").val(filePath);
			},
			error:function(data,status){
				console.info(data);
			}
		});
  }
  function clickinput(){
	  return $("#upFile").click();
  }
  
  
  
  
  $(document)
			.ready(
					
					);
	
	 var websocket = null;
     var nickName = "gqb";
     var humanId=$("#humanId").val();
     //判断当前浏览器是否支持WebSocket
     if('WebSocket' in window){
         websocket = new WebSocket("ws://20.14.0.73:8380/DocMan/websocket/"+humanId);
     }
     else{
         alert('Not support websocket')
     }
    
     websocket.onerror = WSonError;
      
     websocket.onopen = WSonOpen;
      
     websocket.onmessage = WSonMessage;
      
     websocket.onclose = WSonClose;  
     
     window.onbeforeunload = WSonBeforeUnload;
     
     function setMessageInnerHTML(innerHTML){
         document.getElementById('message').innerHTML += innerHTML + '<br/>';
     }
     function WSonOpen(){
     }
     function WSonError(){
    	 alert("socket连接发生错误");
     }
     function WSonMessage(event){
    	 //alert(event.data);
    	var jsonData=eval("("+event.data+")");
    	 var unacceptCount=jsonData["fileCount"];
    	 var humanName=jsonData["fromHumanName"];
    	 $("#unaccpetCount").css("display", "block");
    	 $("#unacceptCount").text(unacceptCount);
    	 $("#unacceptCount").show();
    	 toast.successpush(humanName+"向你发送了"+unacceptCount+"文件"+"移动还有个文件未接收", "温馨提示");
     }
     function WSonClose(){
    	 //alert("退出聊天室");
     }
     function closeWebSocket(){
   	  websocket.close();
     }
     function WSonBeforeUnload(){
   	  websocket.close();
     }
     function send(){
   	  var NowNickName = document.getElementById('nickName').value;
         var message = document.getElementById('text').value;
         websocket.send(NowNickName + ' 说:' +message);
     }
  </script>
</html>
